package com.taxshare.purchaser.controller;

import com.taxshare.mybatis.pager.PageRequest;
import com.taxshare.purchaser.entity.PlaneTicketEntity;
import com.taxshare.purchaser.service.PlaneTicketCollectService;
import com.taxshare.purchaser.view.dto.PlaneTicketDTO;
import com.taxshare.response.beans.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author YANG
 * @date 2021/4/9
 */
@RestController
@RequestMapping("/planeTicketCollect")
@Api(tags = "飞机行程单采集")
public class PlaneTicketCollectController {

    @Autowired
    PlaneTicketCollectService planeTicketCollectService;

    @PostMapping("/query")
    @ApiOperation(value = "飞机行程单查询", notes = "发票采集")
    public Response<PlaneTicketEntity> queryPlaneTicket(@RequestBody PageRequest<PlaneTicketDTO> query) {
        return planeTicketCollectService.queryPlaneTicket(query);
    }

    @PostMapping("/queryDetail")
    @ApiOperation(value = "飞机行程单航班信息查询", notes = "发票采集")
    public Response queryPlaneTicketDetail(@RequestBody PageRequest<PlaneTicketDTO> query) {
        return planeTicketCollectService.queryPlaneTicketDetail(query);
    }

    @PostMapping("/delete")
    @ApiOperation(value = "飞机行程单删除", notes = "发票采集")
    public Response planeTickeDelete(@RequestBody PlaneTicketDTO planeTicketDTO) {
        return planeTicketCollectService.planeTickeDelete(planeTicketDTO);
    }

    @PostMapping("/personLiable")
    @ApiOperation(value = "责任人、记账科目、授权报销设置设置", notes = "未报销")
    public Response personLiable(@RequestBody PlaneTicketDTO planeTicketDTO) {
        return planeTicketCollectService.personLiable(planeTicketDTO);
    }

    @PostMapping("/submit")
    @ApiOperation(value = "提交报销", notes = "未报销")
    public Response submitReimbursement(@RequestBody PlaneTicketDTO planeTicketDTO) {
        return planeTicketCollectService.submitReimbursement(planeTicketDTO);
    }

    @PostMapping("/applicationRejected")
    @ApiOperation(value = "申请驳回", notes = "已报销")
    public Response applicationRejected(@RequestBody PlaneTicketDTO planeTicketDTO) {
        return planeTicketCollectService.applicationRejected(planeTicketDTO);
    }
}
